{__NOLAYOUT__}
<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
    <title></title>
	{include file="public/script" /}
</head>
<body>
	<div class="sectionH  sectionH2 mui-clearfix">
		<header class="mui-bar mui-bar-nav" style="">
			<a class="mui-icon mui-icon-left-nav  mui-pull-left" href="{:url('Index/index')}" style="color: #727272;"></a>
			<h1 class="mui-title">通知</h1>
			<!--<a class="mui-icon mui-pull-right right1" href="assets-1.html"><img src="images/icon_setting.png"/></a>-->
		</header>
	</div>
	<div class="kong1"></div>

	<div class="lian_news_section11">
		<div class="mui-clearfix">
			<ul>
				<li style="width:50%;" onclick="javascript:location.href='/Index/noticeList/type/1.html';" {if condition="$type==1"}class="select"{/if} >会链通知</li>
				<li style="width:50%;" onclick="javascript:location.href='/Index/noticeList/type/2.html';" {if condition="$type==2"}class="select"{/if}>商会通知</li>
			</ul>
		</div>
	</div>


	<div class="kong1"></div>
	<div class="message_section1" id="items" style="position: absolute;z-index: 2;width: 100%;height: 87%;">
		<div class="container" style="position: absolute;width: 100%;z-index: 1;">
			<ul class="lllcccc" style="position: relative;">
				{volist name="list" id="l"}
				<li>
					<a href="{:url('Index/noticeInfo',array('id'=>$l.id))}">
						<div class="div_big mui-clearfix">
							<div class="div1">
								<img src="__STATIC__/www/images/message_icon_notice.png"/>
							</div>
							<div class="div2 mui-clearfix">
								<p class="p1">{$l.name}</p>
								<div class="p2 mui-clearfix">
									<span class="s1">{$l.description}</span>
									<span class="s2">{$l.update_time|show_datetime}</span>
								</div>
							</div>
						</div>
					</a>
				</li>
				{/volist}
			</ul>
		</div>
	</div>
	
	
</body>
<script>
    mui.init({
        pullRefresh: {
            container: '#items',
            down: {

            },
            up: {
                auto:false,
                contentrefresh: '正在加载...',
                callback: pullupRefresh
            }
        }
    });

    var type = "{$type}";
    var count = 1;
    function pullupRefresh() {
        setTimeout(function() {
            // mui('#items').pullRefresh().endPullupToRefresh((++count > 2)); //参数为true代表没有更多数据了。
            var table = document.body.querySelector('.lllcccc');
            var url="{:url('Index/noticeList')}";
            count++;
            $.post(url,{page:count,page_size:10,type:type},function(data){
                var data=JSON.parse(data);
                if(data==0)
                {
                    mui('#items').pullRefresh().endPullupToRefresh((data==0));
                }else{
                    for (var i = 0; i < data.length; i++) {
                        var li = document.createElement('li');
                        var url1="/Index/noticeInfo/id/"+data[i]["id"];
                        li.innerHTML = '<a href="'+url1+'"><div class="div_big mui-clearfix"><div class="div1"><img src="/static/www/images/message_icon_notice.png"/></div><div class="div2 mui-clearfix"><p class="p1">'+data[i]['name']+'</p><div class="p2 mui-clearfix"><span class="s1">'+data[i]['description']+'</span><span class="s2">'+DateToTime(data[i].update_time,'Y-m-d H:i:s')+'</span></div></div></div></a>';
                        table.appendChild(li);
                    }
                }
                mui('#items').pullRefresh().endPullupToRefresh((data==0));
            })

        }, 1000);
    }
</script>
</html>